package com.sf.admin.controller;

import com.sf.admin.model.vo.ServerInfo;
import com.sf.admin.moniter.MonitorService;
import com.sf.admin.service.DbService;
import com.sf.admin.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import oshi.SystemInfo;
import oshi.hardware.HardwareAbstractionLayer;
import oshi.software.os.OperatingSystem;

import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Date;
import java.util.Properties;

@Controller
@RequestMapping("/monitor")
public class MonitorController {

	@Autowired
	private MonitorService monitorService;

	@ResponseBody
	@RequestMapping("/serve")
	public ServerInfo serveInfo() {
		ServerInfo info = monitorService.getServerInfo();
		return info;
	}
}
